package top.rainbowecho.common.validate;

import top.rainbowecho.common.util.CommonUtil;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * @author rainbow
 * @since 2020/4/4 17:12
 */
public class MobilePhoneValidator implements ConstraintValidator<MobilePhone, String> {
    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        return CommonUtil.matchMobilePhone(value);
    }
}
